package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Mobile   string `gorm:"type:char(11)"`
	Password string `gorm:"type:char(32)"`
	Image    string `gorm:"type:varchar(150)"`
	NickName string `gorm:"type:varchar(50)"`
}

// 小说表
type Novel struct {
	gorm.Model
	Title      string `gorm:"type:varchar(50)"`
	ClassId    int64  `gorm:"type:int(11)"`
	Info       string `gorm:"type:varchar(200)"`
	CollectNum int64  `gorm:"type:int(11)"`
}

// 分类表
type Class struct {
	gorm.Model
	Name     string `gorm:"type:varchar(50)"`
	UserId   int64  `gorm:"type:int(11)"`
	NovelNum int64  `gorm:"type:int(11)"`
}

// 评论表
type Comment struct {
	gorm.Model
	UserId  int64  `gorm:"type:int(11)"`
	NovelId int64  `gorm:"type:int(11)"`
	Context string `gorm:"type:varchar(200)"`
}

// 收藏表
type Collect struct {
	gorm.Model
	UserId  int64 `gorm:"type:int(11)"`
	NovelId int64 `gorm:"type:int(11)"`
}

type NovelData struct {
	Novel
	ClassName string `gorm:"type:varchar(50)"`
}
